package com.tony.ai.adapter

import com.tony.ai.bean.ColorBean
import com.tony.ai.bean.ImageBean
import com.tony.ai.databinding.ItemBackgroundColorBinding
import com.tony.ai.databinding.ItemBackgroundImageBinding

class BackgroundImageAdapter(var onItemClick:(pos:Int, item: ImageBean)->Unit):
    BaseListAdapter<ImageBean,ItemBackgroundImageBinding>(ItemBackgroundImageBinding::inflate) {
    override fun bind(binding: ItemBackgroundImageBinding, item: ImageBean, position: Int) {
        binding.ivReplaceBackgroundImage.setBackgroundResource(item.resId)
        binding.root.setOnClickListener {
            onItemClick(position,item)
        }
    }
}